package sim.states;

import ctf.network.ProtocolError;
import sim.ISimulator;
/**
 * Abstract implementation of the Simulators available states.
 * @author N. Bhatia, A. Butt, N. Evans, C. Levesque, P. OKeefe
 *
 */
public abstract class AbstractState {

	protected ISimulator simulator;

	/**
	 * Registers a state with an implementation of ISimulator.
	 * @param simulator
	 */
	public AbstractState(ISimulator simulator) {
		this.simulator = simulator;
	}

	/**
	 * Manages the receiving of requests (messages).
	 * @param clientId The client which is sending the message.
	 * @param request The request to parse.
	 * @throws ProtocolError
	 */
	public abstract void request(int clientId, String request)
			throws ProtocolError;
	/**
	 * Resets the current state to its initial conditions.
	 */
	public void reset() {};

}
